/*
 * Copyright (c) 2009, Jan Pastor. All Rights Reserved.
 */

package sk.jp.jitag.dao.db4o;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import com.db4o.collections.ArrayList4;
import com.db4o.collections.ArrayMap4;

/**
 * Factory for <i>collection</i> components (lists, maps) that are
 * compatible with <i>Db4o</i> database.
 */
public class CollectionsFactory {

    private CollectionsFactory() {
    }

    public static <T> List<T> createList(){
        return new ArrayList4<T>();
    }

    public static <T> List<T> createList(Collection<T> collection){
        return new ArrayList4<T>(collection);
    }

    public static <T> List<T> createList(int initialSize){
        return new ArrayList4<T>(initialSize);
    }

    public static <K, V> Map<K, V> createMap(){
        return new ArrayMap4<K, V>();
    }

}
